﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ProcessManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.ProcessManagement.ProcessDocVMs
{
    public partial class ProcessDocTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ProcessDoc._Route")]
        public ExcelPropety Route_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.RouteId);
        [Display(Name = "_Model._ProcessDoc._Op")]
        public ExcelPropety Op_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.OpId);
        [Display(Name = "_Model._ProcessDoc._OpCode")]
        public ExcelPropety OpCode_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.OpCode);
        [Display(Name = "_Model._ProcessDoc._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.ProductId);
        [Display(Name = "_Model._ProcessDoc._FileName")]
        public ExcelPropety FileName_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.FileName);
        [Display(Name = "_Model._ProcessDoc._FileType")]
        public ExcelPropety FileType_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.FileType);
        [Display(Name = "_Model._ProcessDoc._RemotePc")]
        public ExcelPropety RemotePc_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.RemotePc);
        [Display(Name = "_Model._ProcessDoc._RemotePath")]
        public ExcelPropety RemotePath_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.RemotePath);
        [Display(Name = "_Model._ProcessDoc._UserName")]
        public ExcelPropety UserName_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.UserName);
        [Display(Name = "_Model._ProcessDoc._Pwd")]
        public ExcelPropety Pwd_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.Pwd);
        [Display(Name = "_Model._ProcessDoc._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.CreateTime, true);
        [Display(Name = "_Model._ProcessDoc._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ProcessDoc._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.CreateBy);
        [Display(Name = "_Model._ProcessDoc._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.UpdateBy);
        [Display(Name = "_Model._ProcessDoc._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.IsValid);
        [Display(Name = "_Model._ProcessDoc._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ProcessDoc>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Route_Excel.DataType = ColumnDataType.ComboBox;
            Route_Excel.ListItems = DC.Set<ProcessRoute>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());
            Op_Excel.DataType = ColumnDataType.ComboBox;
            Op_Excel.ListItems = DC.Set<ProcessRouteItem>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ProcessDocImportVM : BaseImportVM<ProcessDocTemplateVM, ProcessDoc>
    {
            //import

    }

}